package org.example.demo.controller.userController;


import io.swagger.annotations.ApiOperation;
import org.example.demo.common.api.CommonResult;
import org.example.demo.dto.UserMessageParam;
import org.example.demo.service.userService.FeedBackService;
import org.example.demo.service.userService.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping
public class MessageController {

    @Autowired
    private MessageService messageService;

    @ApiOperation("将反馈上传至数据库")
    @RequestMapping(value = "/user/message", method = RequestMethod.POST)
    @ResponseBody
    public CommonResult<String> UploadFeedBack(@RequestBody UserMessageParam userMessageParam) {
        return CommonResult.success(messageService.UploadMessage(userMessageParam));
    }
}
